www.gusucode.com > VC编写的串口调试软件 > VC编写的串口调试软件,内含Modbus协议类 支持对Modbus通讯调试/Modbus串口调试软件1.0/com/Protocal.cpp

    // Protocal.cpp: implementation of the CProtocal class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Protocal.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CProtocal::CProtocal()
{
	m_pComData=NULL;
	m_strPrtName="Protocal";
}

CProtocal::~CProtocal()
{

}

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//名称:Traslating
//----------------------------------------------------
//参数:CComData& Data-------------要翻译的数据
//----------------------------------------------------
//功能:对数据进行翻译
//----------------------------------------------------
//返回值:NULL
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
void CProtocal::Decoding(CComData& Data)
{
}

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//名称:ReceiveByte
//----------------------------------------------------
//参数:unsigned char ch-------------接收到的字符
//----------------------------------------------------
//功能:对接收到的数据进行处理
//----------------------------------------------------
//返回值:
//	0------正在接收记录
//	1------字符接收完毕
//	2------要求重发送一次
//  3------校验错误,要求重发一次
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
int CProtocal::ReceiveByte(unsigned char& ch)
{
	return 1;	//表示接收完毕
}

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//IsWaitSend	(时间片访问方式,用于单主站协议多主站应用)
//----------------------------------------------------
//参数:
//----------------------------------------------------
//功能:确定当前是否允许发送数据
//----------------------------------------------------
//返回值:
//			true : 暂不发送
//			false: 可以发送
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
bool CProtocal::IsWaitSend()
{
	return false;
}

void CProtocal::Init()
{

}